const mime = require('mime-types');
const path = require('path');

module.exports = (filePath) => {
    let ext = path.extname(filePath)
        .split('.')
        .pop()
        .toLowerCase();
    if (!ext) {
        ext = filePath;
    }
    return mime.lookup(ext) || mime.lookup('txt');
};
